package com.shujia.singleton;

public class HungrySingleton {

    /**
     * 单例模式：饿汉模式
     * 在类加载的时候，先创建好类的对象
     * 缺点：占用内存资源
     */
    private static HungrySingleton hungrySingleton = new HungrySingleton();

    private HungrySingleton(){
    }

    public static HungrySingleton getInstance() {
        return hungrySingleton;
    }
}
